<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>
<h:body>
	<h:form id="registerForm" rendered="#{!userBean.isRegistered}">
	<p:panelGrid columns="2">
		<p:outputLabel>Username:</p:outputLabel>
		<p:inputText id="username" value="#{userBean.tempUser.username}" />
		<p:outputLabel>Name:</p:outputLabel>
		<p:inputText id="name" value="#{userBean.tempUser.name}" />
		<p:outputLabel>Surname:</p:outputLabel>
		<p:inputText id="surname" value="#{userBean.tempUser.surname}" />
		<p:outputLabel>Birth Date</p:outputLabel>
		<p:inputText id="birthdate" value="#{userBean.tempUser.birthdate}" />
		<p:outputLabel>Email:</p:outputLabel>
		<p:inputText id="email" value="#{userBean.tempUser.email}" />
	
		<p:outputLabel>Password</p:outputLabel>
		<p:password id="password" type="" value="#{userBean.tempUser.password}" />
		<p:outputLabel>Password Again:</p:outputLabel>
		<p:password id="password2" type="" value="#{userBean.tempUser.password2}" />
		
		<p:commandButton value="Register" update="registerForm"
			actionListener="#{userBean.register}" />
	
	</p:panelGrid>
	</h:form>
	
	<h:form id="resultForm" rendered="#{userBean.isRegistered}" >
	<p:outputLabel> You can now login the system </p:outputLabel>
	
	</h:form>
</h:body>
</html>